package com.hxalex.simulationhandle.accessbilityService.command.base;

import android.util.Log;

import com.hxalex.simulationhandle.accessbilityService.base.Command;
import com.hxalex.simulationhandle.accessbilityService.manger.SearchManger;
import com.hxalex.simulationhandle.accessbilityService.manger.WifiManger;
import com.hxalex.simulationhandle.accessbilityService.receiver.base.BaseReceiver;

/**
 * Created by hx_Alex on 2018/5/26.
 */

public class BaseCommand implements Command,BaseReceiver.onCommandComplete {
    private WifiManger wifiManger;
    private SearchManger searchManger;
    public BaseReceiver receiver;
    public  boolean isComplete=false;
    public BaseCommand(WifiManger wifiManger, BaseReceiver receiver)
    {
        this.wifiManger=wifiManger;
        this.receiver=receiver;
        receiver.setOnCommandCompleteListener(this);
    }
    public BaseCommand(SearchManger searchManger, BaseReceiver receiver)
    {
        this.searchManger=searchManger;
        this.receiver=receiver;
        receiver.setOnCommandCompleteListener(this);
    }
   

    @Override
    public void execute() {
        receiver.doSomething();
    }

    @Override
    public void commandCompleteListener() {
        Log.i("Command",receiver.FLAG+"执行完毕");
        isComplete=true;
    }
}
